from django.urls import path
from . import views
from . import views_strategy

urlpatterns = [
    path('', views.home, name='home'),
    path('stocks/', views.stock_list, name='stock_list'),
    path('stocks/<str:symbol>/', views.stock_detail, name='stock_detail'),
    path('stocks/<str:symbol>/daily/', views.daily_data, name='daily_data'),
    path('stocks/<str:symbol>/financial/', views.financial_data, name='financial_data'),
    path('stocks/<str:symbol>/signals/', views.stock_signals, name='stock_signals'),
    path('stocks/<str:symbol>/visualization/', views.stock_visualization, name='stock_visualization'),
    
    # 策略分析相关路由
    path('strategies/', views_strategy.strategy_list, name='strategy_list'),
    path('strategies/<int:strategy_id>/', views_strategy.strategy_detail, name='strategy_detail'),
    path('signals/', views_strategy.buy_signals, name='buy_signals'),
    path('stocks/analyze/<str:symbol>/', views_strategy.analyze_stock, name='analyze_stock'),
    path('analyze-all/', views_strategy.analyze_all_stocks, name='analyze_all_stocks'),
    path('dashboard/', views_strategy.strategy_dashboard, name='strategy_dashboard'),
    path('cleanup-signals/', views_strategy.cleanup_signals, name='cleanup_signals'),
    
    # API接口
    path('api/signals/recent/', views_strategy.api_recent_signals, name='api_recent_signals'),
    path('api/signals/stock/<str:symbol>/', views_strategy.api_stock_signals, name='api_stock_signals'),
    path('api/strategy/<int:strategy_id>/performance/', views_strategy.api_strategy_performance, name='api_strategy_performance'),
]
